var t = wx.cloud.database();

t.command;

Page({
    data: {
        students: [],
        length: 0,
        showModalStatus: !1,
        animationData0: null,
        student: "",
        classname:"",
    },
    drawout: function() {
        var t = (Math.random() * (this.data.length - 1)).toFixed(0);
        console.log(t, "数组下标对应姓名", this.data.students[t]), this.setData({
            student: this.data.students[t]
        });
    },
    onLoad: function(a) {
        var n = this, 
        s = wx.getStorageSync("user");
        console.log(a.class), t.collection("class").where({
            openid: s.openid,
            classname: a.class
        }).get().then(function(t) {
            n.setData({
                students: t.data[0].students,
                length: t.data[0].students.length,
                scrollText: t.data[0].students,
                classname:t.data[0].classname
            });
            var a = (Math.random() * (t.data[0].students.length - 1)).toFixed(0);
            console.log(a, "数组下标对应姓名", n.data.students[a]), n.setData({
                student: n.data.students[a]
            });
        });
    },
    jumpgps:function(a){
      console.log(a.currentTarget.dataset.class)
      wx.navigateTo({
        url: '../gps/teachergps?classname='+a.currentTarget.dataset.class,
      })
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    powerDrawer: function(t) {
        var a = t.currentTarget.dataset.statu;
        this.util(a);
    },
    util: function(t) {
        var a = wx.createAnimation({
            duration: 200,
            timingFunction: "linear",
            delay: 0
        });
        this.animation = a, a.opacity(0).rotateX(-100).step(), this.setData({
            animationData0: a.export()
        }), setTimeout(function() {
            a.opacity(1).rotateX(0).step(), this.setData({
                animationData0: a
            }), "close" == t && this.setData({
                showModalStatus: !1
            });
        }.bind(this), 200), "open" == t && this.setData({
            showModalStatus: !0
        });
    }
});